var http = require('../../utils/http.js')
var util = require('../../utils/util.js')
var localstorage = require('../../utils/localstorage.js')
var appInstance = getApp()
 

Page({

   
  data: {
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    showdes:"",
    datalist:[],
  },
 
  onLoad(options) {
  
    var id=options.id
   var title=decodeURIComponent( options.title)
   wx.setNavigationBarTitle({
    title: title
  })
 

    this.getDetails(id);
  },

  getDetails(id){
    var _this = this;
    var postdata ={
      "Page": 1,
      "PageSize": 99,
      "caseId":id
    }
    http.request({
      url: 'car_case_detailsServiceApi/page',
      method: "Post",
      data: postdata,
      callBack: (res) => {
       // console.log(res)
        let newArr = res.result.items;
      
      console.log(newArr)
        wx.stopPullDownRefresh()
        _this.setData({
          datalist: newArr,
          showdes:newArr[0].des
        })
       
      }
    })
  },

  onSwChange(e)
  {
    var _this=this
   var index=e.detail.current
   _this.setData({
   
    showdes:_this.data.datalist[index].des
  })

  },
  onReady() {

  },
  onShow() {

  },
  onHide() {

  },

  onUnload() {

  },

  onPullDownRefresh() {

  },

  onReachBottom() {

  },

  onShareAppMessage() {

  }
})